﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LibService.DTO;
using System.Data;

namespace LibService.DAO
{
    public class DuongDAO
    {
        #region 1. Lay Danh Sach Thong Tin Duong
        public static List<DuongDTO> layDanhSachDuongDi()
        {
            List<DuongDTO> lst = new List<DuongDTO>();
            try
            {
                SQLConnect cnn = new SQLConnect();
                DataTable dt = new DataTable();
                dt = cnn.ExecuteQuery("", CommandType.Text);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DuongDTO d = new DuongDTO();
                    d.MaDuong = dt.Rows[i]["MaDuong"].ToString();
                    d.TenDuong = dt.Rows[i]["TenDuong"].ToString();
                    lst.Add(d);
                }
            }
            catch (Exception ex)
            {

            }
            return lst;
        }
        #endregion
    }
}